package cn.ms.doctor.Entity;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 
 * @TableName doctor_prescription
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Prescription implements Serializable {
    /**
     * 处方id
     */
    private Integer prescriptionId;

    /**
     * 医生id
     */
    private Integer userId;

    /**
     * 患者id
     */
    private Integer patientId;

    /**
     * 诊断信息
     */
    private String prescriptionDiagnosis;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Prescription other = (Prescription) that;
        return (this.getPrescriptionId() == null ? other.getPrescriptionId() == null : this.getPrescriptionId().equals(other.getPrescriptionId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getPatientId() == null ? other.getPatientId() == null : this.getPatientId().equals(other.getPatientId()))
            && (this.getPrescriptionDiagnosis() == null ? other.getPrescriptionDiagnosis() == null : this.getPrescriptionDiagnosis().equals(other.getPrescriptionDiagnosis()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPrescriptionId() == null) ? 0 : getPrescriptionId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getPatientId() == null) ? 0 : getPatientId().hashCode());
        result = prime * result + ((getPrescriptionDiagnosis() == null) ? 0 : getPrescriptionDiagnosis().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", prescriptionId=").append(prescriptionId);
        sb.append(", userId=").append(userId);
        sb.append(", patientId=").append(patientId);
        sb.append(", prescriptionDiagnosis=").append(prescriptionDiagnosis);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}